package com.colin.userservice.mapper;

import com.colin.bean.User;
import com.colin.bean.UserFollow;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

public interface UserMapper {

    Long selectIdByUsername(String username);

    Boolean insertUser(User user);

    String selectSaltByUsername(String username);

    User selectUserByPhoneNumAndPassword(@Param("phoneNum") String phoneNum, @Param("password") String password);

    String selectSaltByUserPhoneNum(String phoneNum);

    User isExistUser(String phoneNum);

    List<User> getFollowList(String loginId);

    Boolean addFollow(String loginId, String userId , LocalDateTime localDateTime);

    Boolean deleteFollow(String loginId, String userId);

    List<User> searchUser(String description);

    Boolean updateUser(User user);

    Boolean checkFollow(String loginId, String userId);

    Boolean updateFollow(String loginId, String userId, LocalDateTime now);

    Boolean updateAvatorUrl(String loginId, String url);

    User getUserById(String loginId);

    UserFollow getFollow(String loginId, String userId);
}
